package com.zimmur.dao.goods;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zimmur.model.goods.GoodsOrganization;
import com.zimmur.model.goods.view.GoodsOrganizationView;

public interface IGoodsOrganizationDao {
	
	GoodsOrganization selectByGoodsId(long goodsId);
	
	/**
	 * 
	 * @param first
	 * @param size
	 * @param keyword 关键字查询
	 * @param isRecommend 是否推荐 null查询所有，0不推荐/1推荐
	 * @return
	 */
	List<GoodsOrganizationView> selectOrganizationViewByPage(@Param("first")int first,@Param("size")int size,@Param("keyword")String keyword,@Param("isRecommend")Integer isRecommend);
	
	int countOrganizationViewByPage(@Param("keyword")String keyword);
	
	List<GoodsOrganizationView> selectRecommendGoods();
	/**
	 * 通过主键更新数据
	 * @param goodsOrganization
	 * @return
	 */
	int updateByPrimaryKeySelective(GoodsOrganization goodsOrganization);
	/**
	 * 查询已过活动时间，为关闭闪创活动的闪创商品
	 * @param time
	 * @return
	 */
	List<GoodsOrganization> selectByTime(@Param("time")int time);
}
